# -*- coding: utf-8 -*-
# @Time    : 2024/8/30 下午2:27
# @Author  : wb
# @Email   : wb@163.com
# @File    : client_page
# @Software: PyCharm

from time import sleep
from pages.wb_base_page import BasePage
from selenium.webdriver.common.by import By


class ClientCheckPage(BasePage):
    url = '/crm'
    # 定位器
    '''获取购买产品按钮元素'''
    buy_products_locator = (By.CSS_SELECTOR, '#left_list > li:nth-child(6) > a')
    '''获取合同按钮元素'''
    contract_locator = (By.XPATH, '//*[@id="left_list"]/li[7]/a')
    '''获取删除按钮元素'''
    delete_locator = (By.CSS_SELECTOR, '#tab1 > div.container2.top-pad > div > a.btn.btn-primary.del_confirm')
    # 浏览器操作
    def click_check_products(self):
        '''点击购买产品'''
        self.driver.find_element(*self.buy_products_locator).click()
        sleep(3)
    def click_contract(self):
        '''点击合同·'''
        self.driver.find_element(*self.contract_locator).click()
        sleep(2)
    def client_delete(self):
        '''点击删除'''
        self.driver.find_element(*self.delete_locator).click()